﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace PuzzleCoop
{
    public class StartScreen : GameScreen
    {
        public StartScreen()
            : base()
        {
            
        }

        public override void LoadContent()
        {
        }

        public override void Update(GameTime gameTime)
        {


            UpdateInput();
        }

        public void UpdateInput()
        {
            for (int i = 0; i < 4; ++i) // i == playerIndex
            {
                if (Input.ButtonPressed(i, Buttons.Start) || Input.KeyPressed(Keys.Enter))
                {
                    GameScreenManager.Pop();
                    GameScreenManager.Push(new PlayScreen());
                    break;
                }
            }
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            //spriteBatch.GraphicsDevice.Clear(Color.DarkGray);
            spriteBatch.DrawString(PuzzleCoop.Font, 
                                   "Aperte START para iniciar o jogo!", 
                                   new Vector2(100, 50), Color.White);
        }
    }
}   
